//===----------------------------------------------------------------------===//
//
// This source file is part of the Soto for AWS open source project
//
// Copyright (c) 2017-2024 the Soto project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of Soto project authors
//
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//

// THIS FILE IS AUTOMATICALLY GENERATED by https://github.com/soto-project/soto-codegenerator.
// DO NOT EDIT.

#if canImport(FoundationEssentials)
import FoundationEssentials
#else
import Foundation
#endif
@_spi(SotoInternal) import SotoCore

extension BackupGateway {
    // MARK: Enums

    public enum GatewayType: String, CustomStringConvertible, Codable, Sendable, CodingKeyRepresentable {
        case backupVm = "BACKUP_VM"
        public var description: String { return self.rawValue }
    }

    public enum HypervisorState: String, CustomStringConvertible, Codable, Sendable, CodingKeyRepresentable {
        case error = "ERROR"
        case offline = "OFFLINE"
        case online = "ONLINE"
        case pending = "PENDING"
        public var description: String { return self.rawValue }
    }

    public enum SyncMetadataStatus: String, CustomStringConvertible, Codable, Sendable, CodingKeyRepresentable {
        case created = "CREATED"
        case failed = "FAILED"
        case partiallyFailed = "PARTIALLY_FAILED"
        case running = "RUNNING"
        case succeeded = "SUCCEEDED"
        public var description: String { return self.rawValue }
    }

    // MARK: Shapes

    public struct AccessDeniedException: AWSErrorShape {
        /// A description of why you have insufficient permissions.
        public let errorCode: String
        public let message: String?

        @inlinable
        public init(errorCode: String, message: String? = nil) {
            self.errorCode = errorCode
            self.message = message
        }

        private enum CodingKeys: String, CodingKey {
            case errorCode = "ErrorCode"
            case message = "Message"
        }
    }

    public struct AssociateGatewayToServerInput: AWSEncodableShape {
        /// The Amazon Resource Name (ARN) of the gateway. Use the ListGateways operation to return a list of gateways for your account and Amazon Web Services Region.
        public let gatewayArn: String
        /// The Amazon Resource Name (ARN) of the server that hosts your virtual machines.
        public let serverArn: String

        @inlinable
        public init(gatewayArn: String, serverArn: String) {
            self.gatewayArn = gatewayArn
            self.serverArn = serverArn
        }

        public func validate(name: String) throws {
            try self.validate(self.gatewayArn, name: "gatewayArn", parent: name, max: 500)
            try self.validate(self.gatewayArn, name: "gatewayArn", parent: name, min: 50)
            try self.validate(self.gatewayArn, name: "gatewayArn", parent: name, pattern: "^arn:(aws|aws-cn|aws-us-gov):backup-gateway(:[a-zA-Z-0-9]+){3}\\/[a-zA-Z-0-9]+$")
            try self.validate(self.serverArn, name: "serverArn", parent: name, max: 500)
            try self.validate(self.serverArn, name: "serverArn", parent: name, min: 50)
            try self.validate(self.serverArn, name: "serverArn", parent: name, pattern: "^arn:(aws|aws-cn|aws-us-gov):backup-gateway(:[a-zA-Z-0-9]+){3}\\/[a-zA-Z-0-9]+$")
        }

        private enum CodingKeys: String, CodingKey {
            case gatewayArn = "GatewayArn"
            case serverArn = "ServerArn"
        }
    }

    public struct AssociateGatewayToServerOutput: AWSDecodableShape {
        /// The Amazon Resource Name (ARN) of a gateway.
        public let gatewayArn: String?

        @inlinable
        public init(gatewayArn: String? = nil) {
            self.gatewayArn = gatewayArn
        }

        private enum CodingKeys: String, CodingKey {
            case gatewayArn = "GatewayArn"
        }
    }

    public struct BandwidthRateLimitInterval: AWSEncodableShape & AWSDecodableShape {
        /// The average upload rate limit component of the bandwidth rate limit  interval, in bits per second. This field does not appear in the response if  the upload rate limit is not set.  For Backup Gateway, the minimum value is (Value).
        public let averageUploadRateLimitInBitsPerSec: Int64?
        /// The days of the week component of the bandwidth rate limit interval,  represented as ordinal numbers from 0 to 6, where 0 represents Sunday and 6 represents  Saturday.
        public let daysOfWeek: [Int]
        /// The hour of the day to end the bandwidth rate limit interval.
        public let endHourOfDay: Int
        /// The minute of the hour to end the bandwidth rate limit interval.  The bandwidth rate limit interval ends at the end of the minute.  To end an interval at the end of an hour, use the value 59.
        public let endMinuteOfHour: Int
        /// The hour of the day to start the bandwidth rate limit interval.
        public let startHourOfDay: Int
        /// The minute of the hour to start the bandwidth rate limit interval. The  interval begins at the start of that minute. To begin an interval exactly at  the start of the hour, use the value 0.
        public let startMinuteOfHour: Int

        @inlinable
        public init(averageUploadRateLimitInBitsPerSec: Int64? = nil, daysOfWeek: [Int], endHourOfDay: Int, endMinuteOfHour: Int, startHourOfDay: Int, startMinuteOfHour: Int) {
            self.averageUploadRateLimitInBitsPerSec = averageUploadRateLimitInBitsPerSec
            self.daysOfWeek = daysOfWeek
            self.endHourOfDay = endHourOfDay
            self.endMinuteOfHour = endMinuteOfHour
            self.startHourOfDay = startHourOfDay
            self.startMinuteOfHour = startMinuteOfHour
        }

        public func validate(name: String) throws {
            try self.validate(self.averageUploadRateLimitInBitsPerSec, name: "averageUploadRateLimitInBitsPerSec", parent: name, max: 8000000000000)
            try self.validate(self.averageUploadRateLimitInBitsPerSec, name: "averageUploadRateLimitInBitsPerSec", parent: name, min: 51200)
            try self.daysOfWeek.forEach {
                try validate($0, name: "daysOfWeek[]", parent: name, max: 6)
                try validate($0, name: "daysOfWeek[]", parent: name, min: 0)
            }
            try self.validate(self.daysOfWeek, name: "daysOfWeek", parent: name, max: 7)
            try self.validate(self.daysOfWeek, name: "daysOfWeek", parent: name, min: 1)
            try self.validate(self.endHourOfDay, name: "endHourOfDay", parent: name, max: 23)
            try self.validate(self.endHourOfDay, name: "endHourOfDay", parent: name, min: 0)
            try self.validate(self.endMinuteOfHour, name: "endMinuteOfHour", parent: name, max: 59)
            try self.validate(self.endMinuteOfHour, name: "endMinuteOfHour", parent: name, min: 0)
            try self.validate(self.startHourOfDay, name: "startHourOfDay", parent: name, max: 23)
            try self.validate(self.startHourOfDay, name: "startHourOfDay", parent: name, min: 0)
            try self.validate(self.startMinuteOfHour, name: "startMinuteOfHour", parent: name, max: 59)
            try self.validate(self.startMinuteOfHour, name: "startMinuteOfHour", parent: name, min: 0)
        }

        private enum CodingKeys: String, CodingKey {
            case averageUploadRateLimitInBitsPerSec = "AverageUploadRateLimitInBitsPerSec"
            case daysOfWeek = "DaysOfWeek"
            case endHourOfDay = "EndHourOfDay"
            case endMinuteOfHour = "EndMinuteOfHour"
            case startHourOfDay = "StartHourOfDay"
            case startMinuteOfHour = "StartMinuteOfHour"
        }
    }

    public struct ConflictException: AWSErrorShape {
        /// A description of why the operation is not supported.
        public let errorCode: String
        public let message: String?

        @inlinable
        public init(errorCode: String, message: String? = nil) {
            self.errorCode = errorCode
            self.message = message
        }

        private enum CodingKeys: String, CodingKey {
            case errorCode = "ErrorCode"
            case message = "Message"
        }
    }

    public struct CreateGatewayInput: AWSEncodableShape {
        /// The activation key of the created gateway.
        public let activationKey: String
        /// The display name of the created gateway.
        public let gatewayDisplayName: String
        /// The type of created gateway.
        public let gatewayType: GatewayType
        /// A list of up to 50 tags to assign to the gateway. Each tag is a key-value pair.
        public let tags: [Tag]?

        @inlinable
        public init(activationKey: String, gatewayDisplayName: String, gatewayType: GatewayType, tags: [Tag]? = nil) {
            self.activationKey = activationKey
            self.gatewayDisplayName = gatewayDisplayName
            self.gatewayType = gatewayType
            self.tags = tags
        }

        public func validate(name: String) throws {
            try self.validate(self.activationKey, name: "activationKey", parent: name, max: 50)
            try self.validate(self.activationKey, name: "activationKey", parent: name, min: 1)
            try self.validate(self.activationKey, name: "activationKey", parent: name, pattern: "^[0-9a-zA-Z\\-]+$")
            try self.validate(self.gatewayDisplayName, name: "gatewayDisplayName", parent: name, max: 100)
            try self.validate(self.gatewayDisplayName, name: "gatewayDisplayName", parent: name, min: 1)
            try self.validate(self.gatewayDisplayName, name: "gatewayDisplayName", parent: name, pattern: "^[a-zA-Z0-9-]*$")
            try self.tags?.forEach {
                try $0.validate(name: "\(name).tags[]")
            }
        }

        private enum CodingKeys: String, CodingKey {
            case activationKey = "ActivationKey"
            case gatewayDisplayName = "GatewayDisplayName"
            case gatewayType = "GatewayType"
            case tags = "Tags"
        }
    }

    public struct CreateGatewayOutput: AWSDecodableShape {
        /// The Amazon Resource Name (ARN) of the gateway you create.
        public let gatewayArn: String?

        @inlinable
        public init(gatewayArn: String? = nil) {
            self.gatewayArn = gatewayArn
        }

        private enum CodingKeys: String, CodingKey {
            case gatewayArn = "GatewayArn"
        }
    }

    public struct DeleteGatewayInput: AWSEncodableShape {
        /// The Amazon Resource Name (ARN) of the gateway to delete.
        public let gatewayArn: String

        @inlinable
        public init(gatewayArn: String) {
            self.gatewayArn = gatewayArn
        }

        public func validate(name: String) throws {
            try self.validate(self.gatewayArn, name: "gatewayArn", parent: name, max: 500)
            try self.validate(self.gatewayArn, name: "gatewayArn", parent: name, min: 50)
            try self.validate(self.gatewayArn, name: "gatewayArn", parent: name, pattern: "^arn:(aws|aws-cn|aws-us-gov):backup-gateway(:[a-zA-Z-0-9]+){3}\\/[a-zA-Z-0-9]+$")
        }

        private enum CodingKeys: String, CodingKey {
            case gatewayArn = "GatewayArn"
        }
    }

    public struct DeleteGatewayOutput: AWSDecodableShape {
        /// The Amazon Resource Name (ARN) of the gateway you deleted.
        public let gatewayArn: String?

        @inlinable
        public init(gatewayArn: String? = nil) {
            self.gatewayArn = gatewayArn
        }

        private enum CodingKeys: String, CodingKey {
            case gatewayArn = "GatewayArn"
        }
    }

    public struct DeleteHypervisorInput: AWSEncodableShape {
        /// The Amazon Resource Name (ARN) of the hypervisor to delete.
        public let hypervisorArn: String

        @inlinable
        public init(hypervisorArn: String) {
            self.hypervisorArn = hypervisorArn
        }

        public func validate(name: String) throws {
            try self.validate(self.hypervisorArn, name: "hypervisorArn", parent: name, max: 500)
            try self.validate(self.hypervisorArn, name: "hypervisorArn", parent: name, min: 50)
            try self.validate(self.hypervisorArn, name: "hypervisorArn", parent: name, pattern: "^arn:(aws|aws-cn|aws-us-gov):backup-gateway(:[a-zA-Z-0-9]+){3}\\/[a-zA-Z-0-9]+$")
        }

        private enum CodingKeys: String, CodingKey {
            case hypervisorArn = "HypervisorArn"
        }
    }

    public struct DeleteHypervisorOutput: AWSDecodableShape {
        /// The Amazon Resource Name (ARN) of the hypervisor you deleted.
        public let hypervisorArn: String?

        @inlinable
        public init(hypervisorArn: String? = nil) {
            self.hypervisorArn = hypervisorArn
        }

        private enum CodingKeys: String, CodingKey {
            case hypervisorArn = "HypervisorArn"
        }
    }

    public struct DisassociateGatewayFromServerInput: AWSEncodableShape {
        /// The Amazon Resource Name (ARN) of the gateway to disassociate.
        public let gatewayArn: String

        @inlinable
        public init(gatewayArn: String) {
            self.gatewayArn = gatewayArn
        }

        public func validate(name: String) throws {
            try self.validate(self.gatewayArn, name: "gatewayArn", parent: name, max: 500)
            try self.validate(self.gatewayArn, name: "gatewayArn", parent: name, min: 50)
            try self.validate(self.gatewayArn, name: "gatewayArn", parent: name, pattern: "^arn:(aws|aws-cn|aws-us-gov):backup-gateway(:[a-zA-Z-0-9]+){3}\\/[a-zA-Z-0-9]+$")
        }

        private enum CodingKeys: String, CodingKey {
            case gatewayArn = "GatewayArn"
        }
    }

    public struct DisassociateGatewayFromServerOutput: AWSDecodableShape {
        /// The Amazon Resource Name (ARN) of the gateway you disassociated.
        public let gatewayArn: String?

        @inlinable
        public init(gatewayArn: String? = nil) {
            self.gatewayArn = gatewayArn
        }

        private enum CodingKeys: String, CodingKey {
            case gatewayArn = "GatewayArn"
        }
    }

    public struct Gateway: AWSDecodableShape {
        /// The Amazon Resource Name (ARN) of the gateway. Use the ListGateways operation to return a list of gateways for your account and Amazon Web Services Region.
        public let gatewayArn: String?
        /// The display name of the gateway.
        public let gatewayDisplayName: String?
        /// The type of the gateway.
        public let gatewayType: GatewayType?
        /// The hypervisor ID of the gateway.
        public let hypervisorId: String?
        /// The last time Backup gateway communicated with the gateway, in Unix format and UTC time.
        public let lastSeenTime: Date?

        @inlinable
        public init(gatewayArn: String? = nil, gatewayDisplayName: String? = nil, gatewayType: GatewayType? = nil, hypervisorId: String? = nil, lastSeenTime: Date? = nil) {
            self.gatewayArn = gatewayArn
            self.gatewayDisplayName = gatewayDisplayName
            self.gatewayType = gatewayType
            self.hypervisorId = hypervisorId
            self.lastSeenTime = lastSeenTime
        }

        private enum CodingKeys: String, CodingKey {
            case gatewayArn = "GatewayArn"
            case gatewayDisplayName = "GatewayDisplayName"
            case gatewayType = "GatewayType"
            case hypervisorId = "HypervisorId"
            case lastSeenTime = "LastSeenTime"
        }
    }

    public struct GatewayDetails: AWSDecodableShape {
        /// The Amazon Resource Name (ARN) of the  gateway. Use the ListGateways operation to return a list of gateways for your account and  Amazon Web Services Region.
        public let gatewayArn: String?
        /// The display name of the gateway.
        public let gatewayDisplayName: String?
        /// The type of the gateway type.
        public let gatewayType: GatewayType?
        /// The hypervisor ID of the gateway.
        public let hypervisorId: String?
        /// Details showing the last time Backup gateway communicated with the cloud, in Unix format and UTC time.
        public let lastSeenTime: Date?
        /// Returns your gateway's weekly maintenance start time including the day and time of the week.  Note that values are in terms of the gateway's time zone. Can be weekly or monthly.
        public let maintenanceStartTime: MaintenanceStartTime?
        /// Details showing the next update availability time of the  gateway.
        public let nextUpdateAvailabilityTime: Date?
        /// The DNS name for the virtual private cloud (VPC) endpoint the gateway  uses to connect to the cloud for backup gateway.
        public let vpcEndpoint: String?

        @inlinable
        public init(gatewayArn: String? = nil, gatewayDisplayName: String? = nil, gatewayType: GatewayType? = nil, hypervisorId: String? = nil, lastSeenTime: Date? = nil, maintenanceStartTime: MaintenanceStartTime? = nil, nextUpdateAvailabilityTime: Date? = nil, vpcEndpoint: String? = nil) {
            self.gatewayArn = gatewayArn
            self.gatewayDisplayName = gatewayDisplayName
            self.gatewayType = gatewayType
            self.hypervisorId = hypervisorId
            self.lastSeenTime = lastSeenTime
            self.maintenanceStartTime = maintenanceStartTime
            self.nextUpdateAvailabilityTime = nextUpdateAvailabilityTime
            self.vpcEndpoint = vpcEndpoint
        }

        private enum CodingKeys: String, CodingKey {
            case gatewayArn = "GatewayArn"
            case gatewayDisplayName = "GatewayDisplayName"
            case gatewayType = "GatewayType"
            case hypervisorId = "HypervisorId"
            case lastSeenTime = "LastSeenTime"
            case maintenanceStartTime = "MaintenanceStartTime"
            case nextUpdateAvailabilityTime = "NextUpdateAvailabilityTime"
            case vpcEndpoint = "VpcEndpoint"
        }
    }

    public struct GetBandwidthRateLimitScheduleInput: AWSEncodableShape {
        /// The Amazon Resource Name (ARN) of the gateway. Use the   ListGateways operation to return a list of gateways  for your account and Amazon Web Services Region.
        public let gatewayArn: String

        @inlinable
        public init(gatewayArn: String) {
            self.gatewayArn = gatewayArn
        }

        public func validate(name: String) throws {
            try self.validate(self.gatewayArn, name: "gatewayArn", parent: name, max: 500)
            try self.validate(self.gatewayArn, name: "gatewayArn", parent: name, min: 50)
            try self.validate(self.gatewayArn, name: "gatewayArn", parent: name, pattern: "^arn:(aws|aws-cn|aws-us-gov):backup-gateway(:[a-zA-Z-0-9]+){3}\\/[a-zA-Z-0-9]+$")
        }

        private enum CodingKeys: String, CodingKey {
            case gatewayArn = "GatewayArn"
        }
    }

    public struct GetBandwidthRateLimitScheduleOutput: AWSDecodableShape {
        /// An array containing bandwidth rate limit schedule intervals for a gateway.  When no bandwidth rate limit intervals have been scheduled, the array is empty.
        public let bandwidthRateLimitIntervals: [BandwidthRateLimitInterval]?
        /// The Amazon Resource Name (ARN) of the gateway. Use the   ListGateways operation to return a list of gateways  for your account and Amazon Web Services Region.
        public let gatewayArn: String?

        @inlinable
        public init(bandwidthRateLimitIntervals: [BandwidthRateLimitInterval]? = nil, gatewayArn: String? = nil) {
            self.bandwidthRateLimitIntervals = bandwidthRateLimitIntervals
            self.gatewayArn = gatewayArn
        }

        private enum CodingKeys: String, CodingKey {
            case bandwidthRateLimitIntervals = "BandwidthRateLimitIntervals"
            case gatewayArn = "GatewayArn"
        }
    }

    public struct GetGatewayInput: AWSEncodableShape {
        /// The Amazon Resource Name (ARN) of the gateway.
        public let gatewayArn: String

        @inlinable
        public init(gatewayArn: String) {
            self.gatewayArn = gatewayArn
        }

        public func validate(name: String) throws {
            try self.validate(self.gatewayArn, name: "gatewayArn", parent: name, max: 500)
            try self.validate(self.gatewayArn, name: "gatewayArn", parent: name, min: 50)
            try self.validate(self.gatewayArn, name: "gatewayArn", parent: name, pattern: "^arn:(aws|aws-cn|aws-us-gov):backup-gateway(:[a-zA-Z-0-9]+){3}\\/[a-zA-Z-0-9]+$")
        }

        private enum CodingKeys: String, CodingKey {
            case gatewayArn = "GatewayArn"
        }
    }

    public struct GetGatewayOutput: AWSDecodableShape {
        /// By providing the ARN (Amazon Resource Name), this API returns the gateway.
        public let gateway: GatewayDetails?

        @inlinable
        public init(gateway: GatewayDetails? = nil) {
            self.gateway = gateway
        }

        private enum CodingKeys: String, CodingKey {
            case gateway = "Gateway"
        }
    }

    public struct GetHypervisorInput: AWSEncodableShape {
        /// The Amazon Resource Name (ARN) of the hypervisor.
        public let hypervisorArn: String

        @inlinable
        public init(hypervisorArn: String) {
            self.hypervisorArn = hypervisorArn
        }

        public func validate(name: String) throws {
            try self.validate(self.hypervisorArn, name: "hypervisorArn", parent: name, max: 500)
            try self.validate(self.hypervisorArn, name: "hypervisorArn", parent: name, min: 50)
            try self.validate(self.hypervisorArn, name: "hypervisorArn", parent: name, pattern: "^arn:(aws|aws-cn|aws-us-gov):backup-gateway(:[a-zA-Z-0-9]+){3}\\/[a-zA-Z-0-9]+$")
        }

        private enum CodingKeys: String, CodingKey {
            case hypervisorArn = "HypervisorArn"
        }
    }

    public struct GetHypervisorOutput: AWSDecodableShape {
        /// Details about the requested hypervisor.
        public let hypervisor: HypervisorDetails?

        @inlinable
        public init(hypervisor: HypervisorDetails? = nil) {
            self.hypervisor = hypervisor
        }

        private enum CodingKeys: String, CodingKey {
            case hypervisor = "Hypervisor"
        }
    }

    public struct GetHypervisorPropertyMappingsInput: AWSEncodableShape {
        /// The Amazon Resource Name (ARN) of the hypervisor.
        public let hypervisorArn: String

        @inlinable
        public init(hypervisorArn: String) {
            self.hypervisorArn = hypervisorArn
        }

        public func validate(name: String) throws {
            try self.validate(self.hypervisorArn, name: "hypervisorArn", parent: name, max: 500)
            try self.validate(self.hypervisorArn, name: "hypervisorArn", parent: name, min: 50)
            try self.validate(self.hypervisorArn, name: "hypervisorArn", parent: name, pattern: "^arn:(aws|aws-cn|aws-us-gov):backup-gateway(:[a-zA-Z-0-9]+){3}\\/[a-zA-Z-0-9]+$")
        }

        private enum CodingKeys: String, CodingKey {
            case hypervisorArn = "HypervisorArn"
        }
    }

    public struct GetHypervisorPropertyMappingsOutput: AWSDecodableShape {
        /// The Amazon Resource Name (ARN) of the hypervisor.
        public let hypervisorArn: String?
        /// The Amazon Resource Name (ARN) of the IAM role.
        public let iamRoleArn: String?
        /// This is a display of the mappings of on-premises VMware tags to the  Amazon Web Services tags.
        public let vmwareToAwsTagMappings: [VmwareToAwsTagMapping]?

        @inlinable
        public init(hypervisorArn: String? = nil, iamRoleArn: String? = nil, vmwareToAwsTagMappings: [VmwareToAwsTagMapping]? = nil) {
            self.hypervisorArn = hypervisorArn
            self.iamRoleArn = iamRoleArn
            self.vmwareToAwsTagMappings = vmwareToAwsTagMappings
        }

        private enum CodingKeys: String, CodingKey {
            case hypervisorArn = "HypervisorArn"
            case iamRoleArn = "IamRoleArn"
            case vmwareToAwsTagMappings = "VmwareToAwsTagMappings"
        }
    }

    public struct GetVirtualMachineInput: AWSEncodableShape {
        /// The Amazon Resource Name (ARN) of the virtual machine.
        public let resourceArn: String

        @inlinable
        public init(resourceArn: String) {
            self.resourceArn = resourceArn
        }

        public func validate(name: String) throws {
            try self.validate(self.resourceArn, name: "resourceArn", parent: name, max: 500)
            try self.validate(self.resourceArn, name: "resourceArn", parent: name, min: 50)
            try self.validate(self.resourceArn, name: "resourceArn", parent: name, pattern: "^arn:(aws|aws-cn|aws-us-gov):backup-gateway(:[a-zA-Z-0-9]+){3}\\/[a-zA-Z-0-9]+$")
        }

        private enum CodingKeys: String, CodingKey {
            case resourceArn = "ResourceArn"
        }
    }

    public struct GetVirtualMachineOutput: AWSDecodableShape {
        /// This object contains the basic attributes of VirtualMachine contained by the output of  GetVirtualMachine
        public let virtualMachine: VirtualMachineDetails?

        @inlinable
        public init(virtualMachine: VirtualMachineDetails? = nil) {
            self.virtualMachine = virtualMachine
        }

        private enum CodingKeys: String, CodingKey {
            case virtualMachine = "VirtualMachine"
        }
    }

    public struct Hypervisor: AWSDecodableShape {
        /// The server host of the hypervisor. This can be either an IP address or a fully-qualified domain name (FQDN).
        public let host: String?
        /// The Amazon Resource Name (ARN) of the hypervisor.
        public let hypervisorArn: String?
        /// The Amazon Resource Name (ARN) of the Key Management Service used to encrypt the hypervisor.
        public let kmsKeyArn: String?
        /// The name of the hypervisor.
        public let name: String?
        /// The state of the hypervisor.
        public let state: HypervisorState?

        @inlinable
        public init(host: String? = nil, hypervisorArn: String? = nil, kmsKeyArn: String? = nil, name: String? = nil, state: HypervisorState? = nil) {
            self.host = host
            self.hypervisorArn = hypervisorArn
            self.kmsKeyArn = kmsKeyArn
            self.name = name
            self.state = state
        }

        private enum CodingKeys: String, CodingKey {
            case host = "Host"
            case hypervisorArn = "HypervisorArn"
            case kmsKeyArn = "KmsKeyArn"
            case name = "Name"
            case state = "State"
        }
    }

    public struct HypervisorDetails: AWSDecodableShape {
        /// The server host of the hypervisor. This can be either an IP address or  a fully-qualified domain name (FQDN).
        public let host: String?
        /// The Amazon Resource Name (ARN) of the hypervisor.
        public let hypervisorArn: String?
        /// The Amazon Resource Name (ARN) of the KMS   used to encrypt the hypervisor.
        public let kmsKeyArn: String?
        /// This is the time when the most recent successful sync  of metadata occurred.
        public let lastSuccessfulMetadataSyncTime: Date?
        /// This is the most recent status for the indicated metadata sync.
        public let latestMetadataSyncStatus: SyncMetadataStatus?
        /// This is the most recent status for the indicated metadata sync.
        public let latestMetadataSyncStatusMessage: String?
        /// The Amazon Resource Name (ARN) of the group of gateways within  the requested log.
        public let logGroupArn: String?
        /// This is the name of the specified hypervisor.
        public let name: String?
        /// This is the current state of the specified hypervisor. The possible states are PENDING, ONLINE,  OFFLINE, or ERROR.
        public let state: HypervisorState?

        @inlinable
        public init(host: String? = nil, hypervisorArn: String? = nil, kmsKeyArn: String? = nil, lastSuccessfulMetadataSyncTime: Date? = nil, latestMetadataSyncStatus: SyncMetadataStatus? = nil, latestMetadataSyncStatusMessage: String? = nil, logGroupArn: String? = nil, name: String? = nil, state: HypervisorState? = nil) {
            self.host = host
            self.hypervisorArn = hypervisorArn
            self.kmsKeyArn = kmsKeyArn
            self.lastSuccessfulMetadataSyncTime = lastSuccessfulMetadataSyncTime
            self.latestMetadataSyncStatus = latestMetadataSyncStatus
            self.latestMetadataSyncStatusMessage = latestMetadataSyncStatusMessage
            self.logGroupArn = logGroupArn
            self.name = name
            self.state = state
        }

        private enum CodingKeys: String, CodingKey {
            case host = "Host"
            case hypervisorArn = "HypervisorArn"
            case kmsKeyArn = "KmsKeyArn"
            case lastSuccessfulMetadataSyncTime = "LastSuccessfulMetadataSyncTime"
            case latestMetadataSyncStatus = "LatestMetadataSyncStatus"
            case latestMetadataSyncStatusMessage = "LatestMetadataSyncStatusMessage"
            case logGroupArn = "LogGroupArn"
            case name = "Name"
            case state = "State"
        }
    }

    public struct ImportHypervisorConfigurationInput: AWSEncodableShape {
        /// The server host of the hypervisor. This can be either an IP address or a fully-qualified domain name (FQDN).
        public let host: String
        /// The Key Management Service for the hypervisor.
        public let kmsKeyArn: String?
        /// The name of the hypervisor.
        public let name: String
        /// The password for the hypervisor.
        public let password: String?
        /// The tags of the hypervisor configuration to import.
        public let tags: [Tag]?
        /// The username for the hypervisor.
        public let username: String?

        @inlinable
        public init(host: String, kmsKeyArn: String? = nil, name: String, password: String? = nil, tags: [Tag]? = nil, username: String? = nil) {
            self.host = host
            self.kmsKeyArn = kmsKeyArn
            self.name = name
            self.password = password
            self.tags = tags
            self.username = username
        }

        public func validate(name: String) throws {
            try self.validate(self.host, name: "host", parent: name, max: 128)
            try self.validate(self.host, name: "host", parent: name, min: 3)
            try self.validate(self.host, name: "host", parent: name, pattern: "^.+$")
            try self.validate(self.kmsKeyArn, name: "kmsKeyArn", parent: name, max: 500)
            try self.validate(self.kmsKeyArn, name: "kmsKeyArn", parent: name, min: 50)
            try self.validate(self.kmsKeyArn, name: "kmsKeyArn", parent: name, pattern: "^(^arn:(aws|aws-cn|aws-us-gov):kms:([a-zA-Z0-9-]+):([0-9]+):(key|alias)/(\\S+)$)|(^alias/(\\S+)$)$")
            try self.validate(self.name, name: "name", parent: name, max: 100)
            try self.validate(self.name, name: "name", parent: name, min: 1)
            try self.validate(self.name, name: "name", parent: name, pattern: "^[a-zA-Z0-9-]*$")
            try self.validate(self.password, name: "password", parent: name, max: 100)
            try self.validate(self.password, name: "password", parent: name, min: 1)
            try self.validate(self.password, name: "password", parent: name, pattern: "^[ -~]+$")
            try self.tags?.forEach {
                try $0.validate(name: "\(name).tags[]")
            }
            try self.validate(self.username, name: "username", parent: name, max: 100)
            try self.validate(self.username, name: "username", parent: name, min: 1)
            try self.validate(self.username, name: "username", parent: name, pattern: "^[ -\\.0-\\[\\]-~]*[!-\\.0-\\[\\]-~][ -\\.0-\\[\\]-~]*$")
        }

        private enum CodingKeys: String, CodingKey {
            case host = "Host"
            case kmsKeyArn = "KmsKeyArn"
            case name = "Name"
            case password = "Password"
            case tags = "Tags"
            case username = "Username"
        }
    }

    public struct ImportHypervisorConfigurationOutput: AWSDecodableShape {
        /// The Amazon Resource Name (ARN) of the hypervisor you disassociated.
        public let hypervisorArn: String?

        @inlinable
        public init(hypervisorArn: String? = nil) {
            self.hypervisorArn = hypervisorArn
        }

        private enum CodingKeys: String, CodingKey {
            case hypervisorArn = "HypervisorArn"
        }
    }

    public struct ListGatewaysInput: AWSEncodableShape {
        /// The maximum number of gateways to list.
        public let maxResults: Int?
        /// The next item following a partial list of returned resources. For example, if a request is made to return MaxResults number of resources, NextToken allows you to return more items in your list starting at the location pointed to by the next token.
        public let nextToken: String?

        @inlinable
        public init(maxResults: Int? = nil, nextToken: String? = nil) {
            self.maxResults = maxResults
            self.nextToken = nextToken
        }

        public func validate(name: String) throws {
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 1)
            try self.validate(self.nextToken, name: "nextToken", parent: name, max: 1000)
            try self.validate(self.nextToken, name: "nextToken", parent: name, min: 1)
            try self.validate(self.nextToken, name: "nextToken", parent: name, pattern: "^.+$")
        }

        private enum CodingKeys: String, CodingKey {
            case maxResults = "MaxResults"
            case nextToken = "NextToken"
        }
    }

    public struct ListGatewaysOutput: AWSDecodableShape {
        /// A list of your gateways.
        public let gateways: [Gateway]?
        /// The next item following a partial list of returned resources. For example, if a request is made to return maxResults number of resources, NextToken allows you to return more items in your list starting at the location pointed to by the next token.
        public let nextToken: String?

        @inlinable
        public init(gateways: [Gateway]? = nil, nextToken: String? = nil) {
            self.gateways = gateways
            self.nextToken = nextToken
        }

        private enum CodingKeys: String, CodingKey {
            case gateways = "Gateways"
            case nextToken = "NextToken"
        }
    }

    public struct ListHypervisorsInput: AWSEncodableShape {
        /// The maximum number of hypervisors to list.
        public let maxResults: Int?
        /// The next item following a partial list of returned resources. For example, if a request is made to return maxResults number of resources, NextToken allows you to return more items in your list starting at the location pointed to by the next token.
        public let nextToken: String?

        @inlinable
        public init(maxResults: Int? = nil, nextToken: String? = nil) {
            self.maxResults = maxResults
            self.nextToken = nextToken
        }

        public func validate(name: String) throws {
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 1)
            try self.validate(self.nextToken, name: "nextToken", parent: name, max: 1000)
            try self.validate(self.nextToken, name: "nextToken", parent: name, min: 1)
            try self.validate(self.nextToken, name: "nextToken", parent: name, pattern: "^.+$")
        }

        private enum CodingKeys: String, CodingKey {
            case maxResults = "MaxResults"
            case nextToken = "NextToken"
        }
    }

    public struct ListHypervisorsOutput: AWSDecodableShape {
        /// A list of your Hypervisor objects, ordered by their Amazon Resource Names (ARNs).
        public let hypervisors: [Hypervisor]?
        /// The next item following a partial list of returned resources. For example, if a request is made to return maxResults number of resources, NextToken allows you to return more items in your list starting at the location pointed to by the next token.
        public let nextToken: String?

        @inlinable
        public init(hypervisors: [Hypervisor]? = nil, nextToken: String? = nil) {
            self.hypervisors = hypervisors
            self.nextToken = nextToken
        }

        private enum CodingKeys: String, CodingKey {
            case hypervisors = "Hypervisors"
            case nextToken = "NextToken"
        }
    }

    public struct ListTagsForResourceInput: AWSEncodableShape {
        /// The Amazon Resource Name (ARN) of the resource's tags to list.
        public let resourceArn: String

        @inlinable
        public init(resourceArn: String) {
            self.resourceArn = resourceArn
        }

        public func validate(name: String) throws {
            try self.validate(self.resourceArn, name: "resourceArn", parent: name, max: 500)
            try self.validate(self.resourceArn, name: "resourceArn", parent: name, min: 50)
            try self.validate(self.resourceArn, name: "resourceArn", parent: name, pattern: "^arn:(aws|aws-cn|aws-us-gov):backup-gateway(:[a-zA-Z-0-9]+){3}\\/[a-zA-Z-0-9]+$")
        }

        private enum CodingKeys: String, CodingKey {
            case resourceArn = "ResourceArn"
        }
    }

    public struct ListTagsForResourceOutput: AWSDecodableShape {
        /// The Amazon Resource Name (ARN) of the resource's tags that you listed.
        public let resourceArn: String?
        /// A list of the resource's tags.
        public let tags: [Tag]?

        @inlinable
        public init(resourceArn: String? = nil, tags: [Tag]? = nil) {
            self.resourceArn = resourceArn
            self.tags = tags
        }

        private enum CodingKeys: String, CodingKey {
            case resourceArn = "ResourceArn"
            case tags = "Tags"
        }
    }

    public struct ListVirtualMachinesInput: AWSEncodableShape {
        /// The Amazon Resource Name (ARN) of the hypervisor connected to your virtual machine.
        public let hypervisorArn: String?
        /// The maximum number of virtual machines to list.
        public let maxResults: Int?
        /// The next item following a partial list of returned resources. For example, if a request is made to return maxResults number of resources, NextToken allows you to return more items in your list starting at the location pointed to by the next token.
        public let nextToken: String?

        @inlinable
        public init(hypervisorArn: String? = nil, maxResults: Int? = nil, nextToken: String? = nil) {
            self.hypervisorArn = hypervisorArn
            self.maxResults = maxResults
            self.nextToken = nextToken
        }

        public func validate(name: String) throws {
            try self.validate(self.hypervisorArn, name: "hypervisorArn", parent: name, max: 500)
            try self.validate(self.hypervisorArn, name: "hypervisorArn", parent: name, min: 50)
            try self.validate(self.hypervisorArn, name: "hypervisorArn", parent: name, pattern: "^arn:(aws|aws-cn|aws-us-gov):backup-gateway(:[a-zA-Z-0-9]+){3}\\/[a-zA-Z-0-9]+$")
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 1)
            try self.validate(self.nextToken, name: "nextToken", parent: name, max: 1000)
            try self.validate(self.nextToken, name: "nextToken", parent: name, min: 1)
            try self.validate(self.nextToken, name: "nextToken", parent: name, pattern: "^.+$")
        }

        private enum CodingKeys: String, CodingKey {
            case hypervisorArn = "HypervisorArn"
            case maxResults = "MaxResults"
            case nextToken = "NextToken"
        }
    }

    public struct ListVirtualMachinesOutput: AWSDecodableShape {
        /// The next item following a partial list of returned resources. For example, if a request is made to return maxResults number of resources, NextToken allows you to return more items in your list starting at the location pointed to by the next token.
        public let nextToken: String?
        /// A list of your VirtualMachine objects, ordered by their Amazon Resource Names (ARNs).
        public let virtualMachines: [VirtualMachine]?

        @inlinable
        public init(nextToken: String? = nil, virtualMachines: [VirtualMachine]? = nil) {
            self.nextToken = nextToken
            self.virtualMachines = virtualMachines
        }

        private enum CodingKeys: String, CodingKey {
            case nextToken = "NextToken"
            case virtualMachines = "VirtualMachines"
        }
    }

    public struct MaintenanceStartTime: AWSDecodableShape {
        /// The day of the month component of the maintenance start time represented as an ordinal number from  1 to 28, where 1 represents the first day of the month and 28 represents the last day of the month.
        public let dayOfMonth: Int?
        /// An ordinal number between 0 and 6 that represents the day of the week, where 0 represents Sunday  and 6 represents Saturday. The day of week is in the time zone of the gateway.
        public let dayOfWeek: Int?
        /// The hour component of the maintenance start time represented as hh,  where hh is the hour (0 to 23). The hour of the day is in the time zone of the gateway.
        public let hourOfDay: Int
        /// The minute component of the maintenance start time represented as mm, where  mm is the minute (0 to 59). The minute of the hour is in the time zone of the gateway.
        public let minuteOfHour: Int

        @inlinable
        public init(dayOfMonth: Int? = nil, dayOfWeek: Int? = nil, hourOfDay: Int, minuteOfHour: Int) {
            self.dayOfMonth = dayOfMonth
            self.dayOfWeek = dayOfWeek
            self.hourOfDay = hourOfDay
            self.minuteOfHour = minuteOfHour
        }

        private enum CodingKeys: String, CodingKey {
            case dayOfMonth = "DayOfMonth"
            case dayOfWeek = "DayOfWeek"
            case hourOfDay = "HourOfDay"
            case minuteOfHour = "MinuteOfHour"
        }
    }

    public struct PutBandwidthRateLimitScheduleInput: AWSEncodableShape {
        /// An array containing bandwidth rate limit schedule intervals for a gateway.  When no bandwidth rate limit intervals have been scheduled, the array is empty.
        public let bandwidthRateLimitIntervals: [BandwidthRateLimitInterval]
        /// The Amazon Resource Name (ARN) of the gateway. Use the   ListGateways operation to return a list of gateways  for your account and Amazon Web Services Region.
        public let gatewayArn: String

        @inlinable
        public init(bandwidthRateLimitIntervals: [BandwidthRateLimitInterval], gatewayArn: String) {
            self.bandwidthRateLimitIntervals = bandwidthRateLimitIntervals
            self.gatewayArn = gatewayArn
        }

        public func validate(name: String) throws {
            try self.bandwidthRateLimitIntervals.forEach {
                try $0.validate(name: "\(name).bandwidthRateLimitIntervals[]")
            }
            try self.validate(self.bandwidthRateLimitIntervals, name: "bandwidthRateLimitIntervals", parent: name, max: 20)
            try self.validate(self.gatewayArn, name: "gatewayArn", parent: name, max: 500)
            try self.validate(self.gatewayArn, name: "gatewayArn", parent: name, min: 50)
            try self.validate(self.gatewayArn, name: "gatewayArn", parent: name, pattern: "^arn:(aws|aws-cn|aws-us-gov):backup-gateway(:[a-zA-Z-0-9]+){3}\\/[a-zA-Z-0-9]+$")
        }

        private enum CodingKeys: String, CodingKey {
            case bandwidthRateLimitIntervals = "BandwidthRateLimitIntervals"
            case gatewayArn = "GatewayArn"
        }
    }

    public struct PutBandwidthRateLimitScheduleOutput: AWSDecodableShape {
        /// The Amazon Resource Name (ARN) of the gateway. Use the   ListGateways operation to return a list of gateways  for your account and Amazon Web Services Region.
        public let gatewayArn: String?

        @inlinable
        public init(gatewayArn: String? = nil) {
            self.gatewayArn = gatewayArn
        }

        private enum CodingKeys: String, CodingKey {
            case gatewayArn = "GatewayArn"
        }
    }

    public struct PutHypervisorPropertyMappingsInput: AWSEncodableShape {
        /// The Amazon Resource Name (ARN) of the hypervisor.
        public let hypervisorArn: String
        /// The Amazon Resource Name (ARN) of the IAM role.
        public let iamRoleArn: String
        /// This action requests the mappings of on-premises VMware tags to the  Amazon Web Services tags.
        public let vmwareToAwsTagMappings: [VmwareToAwsTagMapping]

        @inlinable
        public init(hypervisorArn: String, iamRoleArn: String, vmwareToAwsTagMappings: [VmwareToAwsTagMapping]) {
            self.hypervisorArn = hypervisorArn
            self.iamRoleArn = iamRoleArn
            self.vmwareToAwsTagMappings = vmwareToAwsTagMappings
        }

        public func validate(name: String) throws {
            try self.validate(self.hypervisorArn, name: "hypervisorArn", parent: name, max: 500)
            try self.validate(self.hypervisorArn, name: "hypervisorArn", parent: name, min: 50)
            try self.validate(self.hypervisorArn, name: "hypervisorArn", parent: name, pattern: "^arn:(aws|aws-cn|aws-us-gov):backup-gateway(:[a-zA-Z-0-9]+){3}\\/[a-zA-Z-0-9]+$")
            try self.validate(self.iamRoleArn, name: "iamRoleArn", parent: name, max: 2048)
            try self.validate(self.iamRoleArn, name: "iamRoleArn", parent: name, min: 20)
            try self.validate(self.iamRoleArn, name: "iamRoleArn", parent: name, pattern: "^arn:(aws|aws-cn|aws-us-gov):iam::([0-9]+):role/(\\S+)$")
            try self.vmwareToAwsTagMappings.forEach {
                try $0.validate(name: "\(name).vmwareToAwsTagMappings[]")
            }
        }

        private enum CodingKeys: String, CodingKey {
            case hypervisorArn = "HypervisorArn"
            case iamRoleArn = "IamRoleArn"
            case vmwareToAwsTagMappings = "VmwareToAwsTagMappings"
        }
    }

    public struct PutHypervisorPropertyMappingsOutput: AWSDecodableShape {
        /// The Amazon Resource Name (ARN) of the hypervisor.
        public let hypervisorArn: String?

        @inlinable
        public init(hypervisorArn: String? = nil) {
            self.hypervisorArn = hypervisorArn
        }

        private enum CodingKeys: String, CodingKey {
            case hypervisorArn = "HypervisorArn"
        }
    }

    public struct PutMaintenanceStartTimeInput: AWSEncodableShape {
        /// The day of the month start maintenance on a gateway. Valid values range from Sunday to Saturday.
        public let dayOfMonth: Int?
        /// The day of the week to start maintenance on a gateway.
        public let dayOfWeek: Int?
        /// The Amazon Resource Name (ARN) for the gateway, used to specify its maintenance start time.
        public let gatewayArn: String
        /// The hour of the day to start maintenance on a gateway.
        public let hourOfDay: Int
        /// The minute of the hour to start maintenance on a gateway.
        public let minuteOfHour: Int

        @inlinable
        public init(dayOfMonth: Int? = nil, dayOfWeek: Int? = nil, gatewayArn: String, hourOfDay: Int, minuteOfHour: Int) {
            self.dayOfMonth = dayOfMonth
            self.dayOfWeek = dayOfWeek
            self.gatewayArn = gatewayArn
            self.hourOfDay = hourOfDay
            self.minuteOfHour = minuteOfHour
        }

        public func validate(name: String) throws {
            try self.validate(self.dayOfMonth, name: "dayOfMonth", parent: name, max: 31)
            try self.validate(self.dayOfMonth, name: "dayOfMonth", parent: name, min: 1)
            try self.validate(self.dayOfWeek, name: "dayOfWeek", parent: name, max: 6)
            try self.validate(self.dayOfWeek, name: "dayOfWeek", parent: name, min: 0)
            try self.validate(self.gatewayArn, name: "gatewayArn", parent: name, max: 500)
            try self.validate(self.gatewayArn, name: "gatewayArn", parent: name, min: 50)
            try self.validate(self.gatewayArn, name: "gatewayArn", parent: name, pattern: "^arn:(aws|aws-cn|aws-us-gov):backup-gateway(:[a-zA-Z-0-9]+){3}\\/[a-zA-Z-0-9]+$")
            try self.validate(self.hourOfDay, name: "hourOfDay", parent: name, max: 23)
            try self.validate(self.hourOfDay, name: "hourOfDay", parent: name, min: 0)
            try self.validate(self.minuteOfHour, name: "minuteOfHour", parent: name, max: 59)
            try self.validate(self.minuteOfHour, name: "minuteOfHour", parent: name, min: 0)
        }

        private enum CodingKeys: String, CodingKey {
            case dayOfMonth = "DayOfMonth"
            case dayOfWeek = "DayOfWeek"
            case gatewayArn = "GatewayArn"
            case hourOfDay = "HourOfDay"
            case minuteOfHour = "MinuteOfHour"
        }
    }

    public struct PutMaintenanceStartTimeOutput: AWSDecodableShape {
        /// The Amazon Resource Name (ARN) of a gateway for which you set the maintenance start time.
        public let gatewayArn: String?

        @inlinable
        public init(gatewayArn: String? = nil) {
            self.gatewayArn = gatewayArn
        }

        private enum CodingKeys: String, CodingKey {
            case gatewayArn = "GatewayArn"
        }
    }

    public struct ResourceNotFoundException: AWSErrorShape {
        /// A description of which resource wasn't found.
        public let errorCode: String?
        public let message: String?

        @inlinable
        public init(errorCode: String? = nil, message: String? = nil) {
            self.errorCode = errorCode
            self.message = message
        }

        private enum CodingKeys: String, CodingKey {
            case errorCode = "ErrorCode"
            case message = "Message"
        }
    }

    public struct StartVirtualMachinesMetadataSyncInput: AWSEncodableShape {
        /// The Amazon Resource Name (ARN) of the hypervisor.
        public let hypervisorArn: String

        @inlinable
        public init(hypervisorArn: String) {
            self.hypervisorArn = hypervisorArn
        }

        public func validate(name: String) throws {
            try self.validate(self.hypervisorArn, name: "hypervisorArn", parent: name, max: 500)
            try self.validate(self.hypervisorArn, name: "hypervisorArn", parent: name, min: 50)
            try self.validate(self.hypervisorArn, name: "hypervisorArn", parent: name, pattern: "^arn:(aws|aws-cn|aws-us-gov):backup-gateway(:[a-zA-Z-0-9]+){3}\\/[a-zA-Z-0-9]+$")
        }

        private enum CodingKeys: String, CodingKey {
            case hypervisorArn = "HypervisorArn"
        }
    }

    public struct StartVirtualMachinesMetadataSyncOutput: AWSDecodableShape {
        /// The Amazon Resource Name (ARN) of the hypervisor.
        public let hypervisorArn: String?

        @inlinable
        public init(hypervisorArn: String? = nil) {
            self.hypervisorArn = hypervisorArn
        }

        private enum CodingKeys: String, CodingKey {
            case hypervisorArn = "HypervisorArn"
        }
    }

    public struct Tag: AWSEncodableShape & AWSDecodableShape {
        /// The key part of a tag's key-value pair. The key can't start with aws:.
        public let key: String
        /// The value part of a tag's key-value pair.
        public let value: String

        @inlinable
        public init(key: String, value: String) {
            self.key = key
            self.value = value
        }

        public func validate(name: String) throws {
            try self.validate(self.key, name: "key", parent: name, max: 128)
            try self.validate(self.key, name: "key", parent: name, min: 1)
            try self.validate(self.key, name: "key", parent: name, pattern: "^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*)$")
            try self.validate(self.value, name: "value", parent: name, max: 256)
            try self.validate(self.value, name: "value", parent: name, pattern: "^[^\\x00]*$")
        }

        private enum CodingKeys: String, CodingKey {
            case key = "Key"
            case value = "Value"
        }
    }

    public struct TagResourceInput: AWSEncodableShape {
        /// The Amazon Resource Name (ARN) of the resource to tag.
        public let resourceARN: String
        /// A list of tags to assign to the resource.
        public let tags: [Tag]

        @inlinable
        public init(resourceARN: String, tags: [Tag]) {
            self.resourceARN = resourceARN
            self.tags = tags
        }

        public func validate(name: String) throws {
            try self.validate(self.resourceARN, name: "resourceARN", parent: name, max: 500)
            try self.validate(self.resourceARN, name: "resourceARN", parent: name, min: 50)
            try self.validate(self.resourceARN, name: "resourceARN", parent: name, pattern: "^arn:(aws|aws-cn|aws-us-gov):backup-gateway(:[a-zA-Z-0-9]+){3}\\/[a-zA-Z-0-9]+$")
            try self.tags.forEach {
                try $0.validate(name: "\(name).tags[]")
            }
        }

        private enum CodingKeys: String, CodingKey {
            case resourceARN = "ResourceARN"
            case tags = "Tags"
        }
    }

    public struct TagResourceOutput: AWSDecodableShape {
        /// The Amazon Resource Name (ARN) of the resource you tagged.
        public let resourceARN: String?

        @inlinable
        public init(resourceARN: String? = nil) {
            self.resourceARN = resourceARN
        }

        private enum CodingKeys: String, CodingKey {
            case resourceARN = "ResourceARN"
        }
    }

    public struct TestHypervisorConfigurationInput: AWSEncodableShape {
        /// The Amazon Resource Name (ARN) of the gateway to the hypervisor to test.
        public let gatewayArn: String
        /// The server host of the hypervisor. This can be either an IP address or a fully-qualified domain name (FQDN).
        public let host: String
        /// The password for the hypervisor.
        public let password: String?
        /// The username for the hypervisor.
        public let username: String?

        @inlinable
        public init(gatewayArn: String, host: String, password: String? = nil, username: String? = nil) {
            self.gatewayArn = gatewayArn
            self.host = host
            self.password = password
            self.username = username
        }

        public func validate(name: String) throws {
            try self.validate(self.gatewayArn, name: "gatewayArn", parent: name, max: 500)
            try self.validate(self.gatewayArn, name: "gatewayArn", parent: name, min: 50)
            try self.validate(self.gatewayArn, name: "gatewayArn", parent: name, pattern: "^arn:(aws|aws-cn|aws-us-gov):backup-gateway(:[a-zA-Z-0-9]+){3}\\/[a-zA-Z-0-9]+$")
            try self.validate(self.host, name: "host", parent: name, max: 128)
            try self.validate(self.host, name: "host", parent: name, min: 3)
            try self.validate(self.host, name: "host", parent: name, pattern: "^.+$")
            try self.validate(self.password, name: "password", parent: name, max: 100)
            try self.validate(self.password, name: "password", parent: name, min: 1)
            try self.validate(self.password, name: "password", parent: name, pattern: "^[ -~]+$")
            try self.validate(self.username, name: "username", parent: name, max: 100)
            try self.validate(self.username, name: "username", parent: name, min: 1)
            try self.validate(self.username, name: "username", parent: name, pattern: "^[ -\\.0-\\[\\]-~]*[!-\\.0-\\[\\]-~][ -\\.0-\\[\\]-~]*$")
        }

        private enum CodingKeys: String, CodingKey {
            case gatewayArn = "GatewayArn"
            case host = "Host"
            case password = "Password"
            case username = "Username"
        }
    }

    public struct TestHypervisorConfigurationOutput: AWSDecodableShape {
        public init() {}
    }

    public struct UntagResourceInput: AWSEncodableShape {
        /// The Amazon Resource Name (ARN) of the resource from which to remove tags.
        public let resourceARN: String
        /// The list of tag keys specifying which tags to remove.
        public let tagKeys: [String]

        @inlinable
        public init(resourceARN: String, tagKeys: [String]) {
            self.resourceARN = resourceARN
            self.tagKeys = tagKeys
        }

        public func validate(name: String) throws {
            try self.validate(self.resourceARN, name: "resourceARN", parent: name, max: 500)
            try self.validate(self.resourceARN, name: "resourceARN", parent: name, min: 50)
            try self.validate(self.resourceARN, name: "resourceARN", parent: name, pattern: "^arn:(aws|aws-cn|aws-us-gov):backup-gateway(:[a-zA-Z-0-9]+){3}\\/[a-zA-Z-0-9]+$")
            try self.tagKeys.forEach {
                try validate($0, name: "tagKeys[]", parent: name, max: 128)
                try validate($0, name: "tagKeys[]", parent: name, min: 1)
                try validate($0, name: "tagKeys[]", parent: name, pattern: "^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*)$")
            }
        }

        private enum CodingKeys: String, CodingKey {
            case resourceARN = "ResourceARN"
            case tagKeys = "TagKeys"
        }
    }

    public struct UntagResourceOutput: AWSDecodableShape {
        /// The Amazon Resource Name (ARN) of the resource from which you removed tags.
        public let resourceARN: String?

        @inlinable
        public init(resourceARN: String? = nil) {
            self.resourceARN = resourceARN
        }

        private enum CodingKeys: String, CodingKey {
            case resourceARN = "ResourceARN"
        }
    }

    public struct UpdateGatewayInformationInput: AWSEncodableShape {
        /// The Amazon Resource Name (ARN) of the gateway to update.
        public let gatewayArn: String
        /// The updated display name of the gateway.
        public let gatewayDisplayName: String?

        @inlinable
        public init(gatewayArn: String, gatewayDisplayName: String? = nil) {
            self.gatewayArn = gatewayArn
            self.gatewayDisplayName = gatewayDisplayName
        }

        public func validate(name: String) throws {
            try self.validate(self.gatewayArn, name: "gatewayArn", parent: name, max: 500)
            try self.validate(self.gatewayArn, name: "gatewayArn", parent: name, min: 50)
            try self.validate(self.gatewayArn, name: "gatewayArn", parent: name, pattern: "^arn:(aws|aws-cn|aws-us-gov):backup-gateway(:[a-zA-Z-0-9]+){3}\\/[a-zA-Z-0-9]+$")
            try self.validate(self.gatewayDisplayName, name: "gatewayDisplayName", parent: name, max: 100)
            try self.validate(self.gatewayDisplayName, name: "gatewayDisplayName", parent: name, min: 1)
            try self.validate(self.gatewayDisplayName, name: "gatewayDisplayName", parent: name, pattern: "^[a-zA-Z0-9-]*$")
        }

        private enum CodingKeys: String, CodingKey {
            case gatewayArn = "GatewayArn"
            case gatewayDisplayName = "GatewayDisplayName"
        }
    }

    public struct UpdateGatewayInformationOutput: AWSDecodableShape {
        /// The Amazon Resource Name (ARN) of the gateway you updated.
        public let gatewayArn: String?

        @inlinable
        public init(gatewayArn: String? = nil) {
            self.gatewayArn = gatewayArn
        }

        private enum CodingKeys: String, CodingKey {
            case gatewayArn = "GatewayArn"
        }
    }

    public struct UpdateGatewaySoftwareNowInput: AWSEncodableShape {
        /// The Amazon Resource Name (ARN) of the gateway to be updated.
        public let gatewayArn: String

        @inlinable
        public init(gatewayArn: String) {
            self.gatewayArn = gatewayArn
        }

        public func validate(name: String) throws {
            try self.validate(self.gatewayArn, name: "gatewayArn", parent: name, max: 500)
            try self.validate(self.gatewayArn, name: "gatewayArn", parent: name, min: 50)
            try self.validate(self.gatewayArn, name: "gatewayArn", parent: name, pattern: "^arn:(aws|aws-cn|aws-us-gov):backup-gateway(:[a-zA-Z-0-9]+){3}\\/[a-zA-Z-0-9]+$")
        }

        private enum CodingKeys: String, CodingKey {
            case gatewayArn = "GatewayArn"
        }
    }

    public struct UpdateGatewaySoftwareNowOutput: AWSDecodableShape {
        /// The Amazon Resource Name (ARN) of the gateway you updated.
        public let gatewayArn: String?

        @inlinable
        public init(gatewayArn: String? = nil) {
            self.gatewayArn = gatewayArn
        }

        private enum CodingKeys: String, CodingKey {
            case gatewayArn = "GatewayArn"
        }
    }

    public struct UpdateHypervisorInput: AWSEncodableShape {
        /// The updated host of the hypervisor. This can be either an IP address or a fully-qualified domain name (FQDN).
        public let host: String?
        /// The Amazon Resource Name (ARN) of the hypervisor to update.
        public let hypervisorArn: String
        /// The Amazon Resource Name (ARN) of the group of gateways within the requested log.
        public let logGroupArn: String?
        /// The updated name for the hypervisor
        public let name: String?
        /// The updated password for the hypervisor.
        public let password: String?
        /// The updated username for the hypervisor.
        public let username: String?

        @inlinable
        public init(host: String? = nil, hypervisorArn: String, logGroupArn: String? = nil, name: String? = nil, password: String? = nil, username: String? = nil) {
            self.host = host
            self.hypervisorArn = hypervisorArn
            self.logGroupArn = logGroupArn
            self.name = name
            self.password = password
            self.username = username
        }

        public func validate(name: String) throws {
            try self.validate(self.host, name: "host", parent: name, max: 128)
            try self.validate(self.host, name: "host", parent: name, min: 3)
            try self.validate(self.host, name: "host", parent: name, pattern: "^.+$")
            try self.validate(self.hypervisorArn, name: "hypervisorArn", parent: name, max: 500)
            try self.validate(self.hypervisorArn, name: "hypervisorArn", parent: name, min: 50)
            try self.validate(self.hypervisorArn, name: "hypervisorArn", parent: name, pattern: "^arn:(aws|aws-cn|aws-us-gov):backup-gateway(:[a-zA-Z-0-9]+){3}\\/[a-zA-Z-0-9]+$")
            try self.validate(self.logGroupArn, name: "logGroupArn", parent: name, max: 2048)
            try self.validate(self.logGroupArn, name: "logGroupArn", parent: name, pattern: "^$|^arn:(aws|aws-cn|aws-us-gov):logs:([a-zA-Z0-9-]+):([0-9]+):log-group:[a-zA-Z0-9_\\-\\/\\.]+:\\*$")
            try self.validate(self.name, name: "name", parent: name, max: 100)
            try self.validate(self.name, name: "name", parent: name, min: 1)
            try self.validate(self.name, name: "name", parent: name, pattern: "^[a-zA-Z0-9-]*$")
            try self.validate(self.password, name: "password", parent: name, max: 100)
            try self.validate(self.password, name: "password", parent: name, min: 1)
            try self.validate(self.password, name: "password", parent: name, pattern: "^[ -~]+$")
            try self.validate(self.username, name: "username", parent: name, max: 100)
            try self.validate(self.username, name: "username", parent: name, min: 1)
            try self.validate(self.username, name: "username", parent: name, pattern: "^[ -\\.0-\\[\\]-~]*[!-\\.0-\\[\\]-~][ -\\.0-\\[\\]-~]*$")
        }

        private enum CodingKeys: String, CodingKey {
            case host = "Host"
            case hypervisorArn = "HypervisorArn"
            case logGroupArn = "LogGroupArn"
            case name = "Name"
            case password = "Password"
            case username = "Username"
        }
    }

    public struct UpdateHypervisorOutput: AWSDecodableShape {
        /// The Amazon Resource Name (ARN) of the hypervisor you updated.
        public let hypervisorArn: String?

        @inlinable
        public init(hypervisorArn: String? = nil) {
            self.hypervisorArn = hypervisorArn
        }

        private enum CodingKeys: String, CodingKey {
            case hypervisorArn = "HypervisorArn"
        }
    }

    public struct VirtualMachine: AWSDecodableShape {
        /// The host name of the virtual machine.
        public let hostName: String?
        /// The ID of the virtual machine's hypervisor.
        public let hypervisorId: String?
        /// The most recent date a virtual machine was backed up, in Unix format and UTC time.
        public let lastBackupDate: Date?
        /// The name of the virtual machine.
        public let name: String?
        /// The path of the virtual machine.
        public let path: String?
        /// The Amazon Resource Name (ARN) of the virtual machine. For example, arn:aws:backup-gateway:us-west-1:0000000000000:vm/vm-0000ABCDEFGIJKL.
        public let resourceArn: String?

        @inlinable
        public init(hostName: String? = nil, hypervisorId: String? = nil, lastBackupDate: Date? = nil, name: String? = nil, path: String? = nil, resourceArn: String? = nil) {
            self.hostName = hostName
            self.hypervisorId = hypervisorId
            self.lastBackupDate = lastBackupDate
            self.name = name
            self.path = path
            self.resourceArn = resourceArn
        }

        private enum CodingKeys: String, CodingKey {
            case hostName = "HostName"
            case hypervisorId = "HypervisorId"
            case lastBackupDate = "LastBackupDate"
            case name = "Name"
            case path = "Path"
            case resourceArn = "ResourceArn"
        }
    }

    public struct VirtualMachineDetails: AWSDecodableShape {
        /// The host name of the virtual machine.
        public let hostName: String?
        /// The ID of the virtual machine's hypervisor.
        public let hypervisorId: String?
        /// The most recent date a virtual machine was backed up, in Unix format and UTC time.
        public let lastBackupDate: Date?
        /// The name of the virtual machine.
        public let name: String?
        /// The path of the virtual machine.
        public let path: String?
        /// The Amazon Resource Name (ARN) of the virtual machine. For example,  arn:aws:backup-gateway:us-west-1:0000000000000:vm/vm-0000ABCDEFGIJKL.
        public let resourceArn: String?
        /// These are the details of the VMware tags associated with the specified  virtual machine.
        public let vmwareTags: [VmwareTag]?

        @inlinable
        public init(hostName: String? = nil, hypervisorId: String? = nil, lastBackupDate: Date? = nil, name: String? = nil, path: String? = nil, resourceArn: String? = nil, vmwareTags: [VmwareTag]? = nil) {
            self.hostName = hostName
            self.hypervisorId = hypervisorId
            self.lastBackupDate = lastBackupDate
            self.name = name
            self.path = path
            self.resourceArn = resourceArn
            self.vmwareTags = vmwareTags
        }

        private enum CodingKeys: String, CodingKey {
            case hostName = "HostName"
            case hypervisorId = "HypervisorId"
            case lastBackupDate = "LastBackupDate"
            case name = "Name"
            case path = "Path"
            case resourceArn = "ResourceArn"
            case vmwareTags = "VmwareTags"
        }
    }

    public struct VmwareTag: AWSDecodableShape {
        /// The is the category of VMware.
        public let vmwareCategory: String?
        /// This is a user-defined description of a VMware tag.
        public let vmwareTagDescription: String?
        /// This is the user-defined name of a VMware tag.
        public let vmwareTagName: String?

        @inlinable
        public init(vmwareCategory: String? = nil, vmwareTagDescription: String? = nil, vmwareTagName: String? = nil) {
            self.vmwareCategory = vmwareCategory
            self.vmwareTagDescription = vmwareTagDescription
            self.vmwareTagName = vmwareTagName
        }

        private enum CodingKeys: String, CodingKey {
            case vmwareCategory = "VmwareCategory"
            case vmwareTagDescription = "VmwareTagDescription"
            case vmwareTagName = "VmwareTagName"
        }
    }

    public struct VmwareToAwsTagMapping: AWSEncodableShape & AWSDecodableShape {
        /// The key part of the Amazon Web Services tag's key-value pair.
        public let awsTagKey: String
        /// The value part of the Amazon Web Services tag's key-value pair.
        public let awsTagValue: String
        /// The is the category of VMware.
        public let vmwareCategory: String
        /// This is the user-defined name of a VMware tag.
        public let vmwareTagName: String

        @inlinable
        public init(awsTagKey: String, awsTagValue: String, vmwareCategory: String, vmwareTagName: String) {
            self.awsTagKey = awsTagKey
            self.awsTagValue = awsTagValue
            self.vmwareCategory = vmwareCategory
            self.vmwareTagName = vmwareTagName
        }

        public func validate(name: String) throws {
            try self.validate(self.awsTagKey, name: "awsTagKey", parent: name, max: 128)
            try self.validate(self.awsTagKey, name: "awsTagKey", parent: name, min: 1)
            try self.validate(self.awsTagKey, name: "awsTagKey", parent: name, pattern: "^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*)$")
            try self.validate(self.awsTagValue, name: "awsTagValue", parent: name, max: 256)
            try self.validate(self.awsTagValue, name: "awsTagValue", parent: name, pattern: "^[^\\x00]*$")
            try self.validate(self.vmwareCategory, name: "vmwareCategory", parent: name, max: 80)
            try self.validate(self.vmwareCategory, name: "vmwareCategory", parent: name, min: 1)
            try self.validate(self.vmwareTagName, name: "vmwareTagName", parent: name, max: 80)
            try self.validate(self.vmwareTagName, name: "vmwareTagName", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case awsTagKey = "AwsTagKey"
            case awsTagValue = "AwsTagValue"
            case vmwareCategory = "VmwareCategory"
            case vmwareTagName = "VmwareTagName"
        }
    }
}

// MARK: - Errors

/// Error enum for BackupGateway
public struct BackupGatewayErrorType: AWSErrorType {
    enum Code: String {
        case accessDeniedException = "AccessDeniedException"
        case conflictException = "ConflictException"
        case internalServerException = "InternalServerException"
        case resourceNotFoundException = "ResourceNotFoundException"
        case throttlingException = "ThrottlingException"
        case validationException = "ValidationException"
    }

    private let error: Code
    public let context: AWSErrorContext?

    /// initialize BackupGateway
    public init?(errorCode: String, context: AWSErrorContext) {
        guard let error = Code(rawValue: errorCode) else { return nil }
        self.error = error
        self.context = context
    }

    internal init(_ error: Code) {
        self.error = error
        self.context = nil
    }

    /// return error code string
    public var errorCode: String { self.error.rawValue }

    /// The operation cannot proceed because you have insufficient permissions.
    public static var accessDeniedException: Self { .init(.accessDeniedException) }
    /// The operation cannot proceed because it is not supported.
    public static var conflictException: Self { .init(.conflictException) }
    /// The operation did not succeed because an internal error occurred. Try again later.
    public static var internalServerException: Self { .init(.internalServerException) }
    /// A resource that is required for the action wasn't found.
    public static var resourceNotFoundException: Self { .init(.resourceNotFoundException) }
    /// TPS has been limited to protect against intentional or unintentional  high request volumes.
    public static var throttlingException: Self { .init(.throttlingException) }
    /// The operation did not succeed because a validation error occurred.
    public static var validationException: Self { .init(.validationException) }
}

extension BackupGatewayErrorType: AWSServiceErrorType {
    public static let errorCodeMap: [String: AWSErrorShape.Type] = [
        "AccessDeniedException": BackupGateway.AccessDeniedException.self,
        "ConflictException": BackupGateway.ConflictException.self,
        "ResourceNotFoundException": BackupGateway.ResourceNotFoundException.self
    ]
}

extension BackupGatewayErrorType: Equatable {
    public static func == (lhs: BackupGatewayErrorType, rhs: BackupGatewayErrorType) -> Bool {
        lhs.error == rhs.error
    }
}

extension BackupGatewayErrorType: CustomStringConvertible {
    public var description: String {
        return "\(self.error.rawValue): \(self.message ?? "")"
    }
}
